package com.ybkj.daijia.server.errand;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ybkj.daijia.server.model.Area;
import com.ybkj.daijia.server.model.Company;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

/**
 * 跑腿订单
 */
public class Order implements Serializable {

    /**
     * 新单
     */
    public static final Integer ORDER_STATUS_NEW = 0;
    /**
     * 已派单
     */
    public static final Integer ORDER_STATUS_PAIDAN = 1;
    /**
     * 已接单
     */
    public static final Integer ORDER_STATUS_JIEDAN = 2;
    /**
     * 执行中
     */
    public static final Integer ORDER_STATUS_ZHIXING = 3;
    /**
     * 已完成
     */
    public static final Integer ORDER_STATUS_OK = 4;
    /**
     * 已销单
     */
    public static final Integer ORDER_STATUS_XIAODAN = 5;
    private static final long serialVersionUID = 1L;
    private Long id;
    private String orderNo;//订单号
    private String title;//任务标题
    private Date deliverTime;//交付时间
    private String deliverAddress;//交付地址
    private Double deliverLat;//交付地址纬度
    private Double deliverLng;//交付地址经度
    private Long passengerId;//下单人id
    private String passengerName;//下单人名字
    private String passengerPhone;//下单人电话
    private String orderAddress;//下单地址
    private Double orderLat;//下单地址纬度
    private Double orderLng;//下单地址经度
    @JsonIgnore
    private Long channelId;//渠道id
    private String imgs; //图片地址 多张图片拼接的地址
    private Date startTime;        //任务开始时间
    private String startPhone;        //任务开始电话
    private String startAddress;    //开始地址
    private Double startLat;        //开始地址纬度
    private Double startLng;        //开始地址经度
    private String endPhone;        //交件电话
    private Long orderTypeId;        //订单类型id
    private String orderType;       //订单类型(other,qusong,paidui,daigou)
    private Double startPrice;  //起步价格
    private Double mileagePrice;//行驶里程价格
    private Double travelTimePrice;//服务时间价格
    private Boolean errandValuationMethod;//临时字段(计价方式:false:使用预算费用           true:使用计价器费用)
    private String channelName;//渠道名称
    private Integer status;//订单状态:0:新单  1:已派单  2:已接单  3:执行中  4:已完成  5:已销单
    @JsonIgnore
    private Boolean review;//是否已经评价
    private Double shouldPay;//应付
    private Double realPay;//实收
    private Long employId;//接单人id
    private String employName;//接单人姓名
    private String employPhone;//接单人电话
    private Long companyId;//分公司id
    private String companyName;//分公司名称
    private Company company;//临时字段
    private String appkey;//系统Key
    private Date created;
    private Date updated;
    @JsonIgnore
    private Integer version;
    private String content;//任务内容
    @JsonIgnore
    private String cancelCause;//销单原因
    @JsonIgnore
    private List<OrderMemo> memoList;//订单的所有备注
    @JsonIgnore
    private List<OrderImg> imglist; //订单所有图片集合
    @JsonIgnore
    private List<OrderStatus> statusList;//订单的所有状态记录
    private String memoStr;
    @JsonIgnore
    private Boolean errandFixPrice;
    @JsonIgnore
    private Double cashMoney;
    @JsonIgnore
    private Double signMoney;
    @JsonIgnore
    private Double balanceMoney;
    @JsonIgnore
    private Double mileage;
    @JsonIgnore
    private Integer waitedTime;
    @JsonIgnore
    private Integer travelTime;
    @JsonIgnore
    private PayTypeDetails prePayTypeDetail; // 预支付方式
    @JsonIgnore
    private PayTypeDetails payTypeDetails;//后支付方式
    @JsonIgnore
    private Double driverProfit;//服务人员收入
    @JsonIgnore
    private Double companyProfit;//公司收入
    @JsonIgnore
    private Long driverCompanyId;//司机公司id
    private Long couponId;
    private Double couponMoney;
    private Boolean treatment;
    private Date treatmentDate;     //处理确认时间
    private Double guoluMoney;
    private Double yuanchengMoney;
    private Double otherMoney;
    private Double alipayMoney;
    private Double weixinMoney;
    private Double unionpayMoney;
    private BigDecimal baoxiaoMoney;//报销费用
    private boolean baoxiao;//是否已报销
    private Double discount;
    private Double waitPrice;
    private Long areaId;
    private Area area;
    private Double distance;        //临时存储订单交付地与司机距离
    private String distanceStr;        //临时存储订单交付地与司机距离(字符串)
    private Date finishTime;
    private String employMemo;
    private Double justKilometres;//司机调价（公里数）
    private BigDecimal justMoney;//司机调价（金额）
    private String errandserviceType; // 跑腿业务类型
    private String platNo;  //跑腿车牌号
    private String startDetailed; //详细起点
    private String endDetailed; //详细终点
    private String recipients; //收件人
    private String phone; //收件人电话
    private String weight; //重量
    private String matter; //事项
    private String buyNeeds;//购买需求
    private Double goodsCash;//商品金额
    private Double thanksCash;//感谢费
    private String addServices;//附加服务
    private String tips;//热门标签
    @JsonIgnore
    private List<ErrandOrderTypeOtherServices> otherServices;//附加服务
    @JsonIgnore
    private List<ErrandOrderTypeTips> tipsList;//热门标签
    @JsonIgnore
    private List<ErrandOrderTypeDetailed> errandOrderTypeDetaileds;
    private boolean ifPayed;//是否已预付费
    @JsonIgnore
    private Double protectPrice;
    private OrderReview orderReview;    //订单评价对象

    public Double getProtectPrice() {
        return protectPrice;
    }

    public void setProtectPrice(Double protectPrice) {
        this.protectPrice = protectPrice;
    }

    public boolean isIfPayed() {
        return ifPayed;
    }

    public void setIfPayed(boolean ifPayed) {
        this.ifPayed = ifPayed;
    }

    public Boolean getErrandValuationMethod() {
        return errandValuationMethod;
    }

    public void setErrandValuationMethod(Boolean errandValuationMethod) {
        this.errandValuationMethod = errandValuationMethod;
    }

    public String getStartDetailed() {
        return startDetailed;
    }

    public void setStartDetailed(String startDetailed) {
        this.startDetailed = startDetailed;
    }

    public String getEndDetailed() {
        return endDetailed;
    }

    public void setEndDetailed(String endDetailed) {
        this.endDetailed = endDetailed;
    }

    public String getRecipients() {
        return recipients;
    }

    public void setRecipients(String recipients) {
        this.recipients = recipients;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getMatter() {
        return matter;
    }

    public void setMatter(String matter) {
        this.matter = matter;
    }

    public String getBuyNeeds() {
        return buyNeeds;
    }

    public void setBuyNeeds(String buyNeeds) {
        this.buyNeeds = buyNeeds;
    }

    public Double getGoodsCash() {
        if (null == goodsCash) {
            return 0d;
        }
        return goodsCash;
    }

    public void setGoodsCash(Double goodsCash) {
        this.goodsCash = goodsCash;
    }

    public Double getThanksCash() {
        if (null == thanksCash) {
            return 0d;
        }
        return thanksCash;
    }

    public void setThanksCash(Double thanksCash) {
        this.thanksCash = thanksCash;
    }

    public String getAddServices() {
        return addServices;
    }

    public void setAddServices(String addServices) {
        this.addServices = addServices;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public List<ErrandOrderTypeOtherServices> getOtherServices() {
        return otherServices;
    }

    public void setOtherServices(List<ErrandOrderTypeOtherServices> otherServices) {
        this.otherServices = otherServices;
    }

    public List<ErrandOrderTypeTips> getTipsList() {
        return tipsList;
    }

    public void setTipsList(List<ErrandOrderTypeTips> tipsList) {
        this.tipsList = tipsList;
    }

    public List<ErrandOrderTypeDetailed> getErrandOrderTypeDetaileds() {
        return errandOrderTypeDetaileds;
    }

    public void setErrandOrderTypeDetaileds(
        List<ErrandOrderTypeDetailed> errandOrderTypeDetaileds) {
        this.errandOrderTypeDetaileds = errandOrderTypeDetaileds;
    }

    public String getErrandserviceType() {
        return errandserviceType;
    }

    public void setErrandserviceType(String errandserviceType) {
        this.errandserviceType = errandserviceType;
    }

    public String getPlatNo() {
        return platNo;
    }

    public void setPlatNo(String platNo) {
        this.platNo = platNo;
    }

    public Double getJustKilometres() {
        if (null == justKilometres) {
            return 0d;
        }
        return justKilometres;
    }

    public void setJustKilometres(Double justKilometres) {
        this.justKilometres = justKilometres;
    }

    public BigDecimal getJustMoney() {
        if (null == justMoney) {
            return BigDecimal.ZERO;
        }
        return justMoney;
    }

    public void setJustMoney(BigDecimal justMoney) {
        this.justMoney = justMoney;
    }

    public String getEmployMemo() {
        return employMemo;
    }

    public void setEmployMemo(String employMemo) {
        this.employMemo = employMemo;
    }

    public BigDecimal getBaoxiaoMoney() {
        return baoxiaoMoney;
    }

    public void setBaoxiaoMoney(BigDecimal baoxiaoMoney) {
        this.baoxiaoMoney = baoxiaoMoney;
    }

    public boolean isBaoxiao() {
        return baoxiao;
    }

    public void setBaoxiao(boolean baoxiao) {
        this.baoxiao = baoxiao;
    }

    public Date getFinishTime() {
        return this.finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public Double getDistance() {
        return distance != null ? distance : 0.0;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public String getDistanceStr() {
        return distanceStr != null ? distanceStr : "";
    }

    public void setDistanceStr(String distanceStr) {
        this.distanceStr = distanceStr;
    }

    public Area getArea() {
        return area;
    }

    public void setArea(Area area) {
        this.area = area;
    }

    public Long getAreaId() {
        return areaId;
    }

    public void setAreaId(Long areaId) {
        this.areaId = areaId;
    }

    public Double getWaitPrice() {
        return waitPrice;
    }

    public void setWaitPrice(Double waitPrice) {
        this.waitPrice = waitPrice;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Double getAlipayMoney() {
        if (null == alipayMoney) {
            return 0d;
        }
        return alipayMoney;
    }

    public void setAlipayMoney(Double alipayMoney) {
        this.alipayMoney = alipayMoney;
    }

    public Double getWeixinMoney() {
        if (null == weixinMoney) {
            return 0d;
        }
        return weixinMoney;
    }

    public void setWeixinMoney(Double weixinMoney) {
        this.weixinMoney = weixinMoney;
    }

    public Double getUnionpayMoney() {
        if (null == unionpayMoney) {
            return 0d;
        }
        return unionpayMoney;
    }

    public void setUnionpayMoney(Double unionpayMoney) {
        this.unionpayMoney = unionpayMoney;
    }

    public Double getCouponMoney() {
        if (null == couponMoney) {
            return 0d;
        }
        return couponMoney;
    }

    public void setCouponMoney(Double couponMoney) {
        this.couponMoney = couponMoney;
    }

    public Boolean getTreatment() {
        return treatment;
    }

    public void setTreatment(Boolean treatment) {
        this.treatment = treatment;
    }

    public Date getTreatmentDate() {
        return treatmentDate;
    }

    public void setTreatmentDate(Date treatmentDate) {
        this.treatmentDate = treatmentDate;
    }

    public Double getGuoluMoney() {

        return guoluMoney != null ? guoluMoney : 0.0;
    }

    public void setGuoluMoney(Double guoluMoney) {
        this.guoluMoney = guoluMoney;
    }

    public Double getYuanchengMoney() {
        return yuanchengMoney != null ? yuanchengMoney : 0.0;
    }

    public void setYuanchengMoney(Double yuanchengMoney) {
        this.yuanchengMoney = yuanchengMoney;
    }

    public Double getOtherMoney() {
        return otherMoney != null ? otherMoney : 0.0;
    }

    public void setOtherMoney(Double otherMoney) {
        this.otherMoney = otherMoney;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Double getStartPrice() {
        return startPrice;
    }

    public void setStartPrice(Double startPrice) {
        this.startPrice = startPrice;
    }

    public Double getMileagePrice() {
        return mileagePrice;
    }

    public void setMileagePrice(Double mileagePrice) {
        this.mileagePrice = mileagePrice;
    }

    public Double getTravelTimePrice() {
        return travelTimePrice;
    }

    public void setTravelTimePrice(Double travelTimePrice) {
        this.travelTimePrice = travelTimePrice;
    }

    public String getEndPhone() {
        return endPhone;
    }

    public void setEndPhone(String endPhone) {
        this.endPhone = endPhone;
    }

    public List<OrderImg> getImglist() {
        return imglist;
    }

    public void setImglist(List<OrderImg> imglist) {
        this.imglist = imglist;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getStartPhone() {
        return startPhone;
    }

    public void setStartPhone(String startPhone) {
        this.startPhone = startPhone;
    }

    public String getStartAddress() {
        return startAddress;
    }

    public void setStartAddress(String startAddress) {
        this.startAddress = startAddress;
    }

    public Double getStartLat() {
        return startLat;
    }

    public void setStartLat(Double startLat) {
        this.startLat = startLat;
    }

    public Double getStartLng() {
        return startLng;
    }

    public void setStartLng(Double startLng) {
        this.startLng = startLng;
    }

    public Long getOrderTypeId() {
        return orderTypeId;
    }

    public void setOrderTypeId(Long orderTypeId) {
        this.orderTypeId = orderTypeId;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public String getPassengerPhone() {
        return passengerPhone;
    }

    public void setPassengerPhone(String passengerPhone) {
        this.passengerPhone = passengerPhone;
    }

    public String getEmployPhone() {
        return employPhone;
    }

    public void setEmployPhone(String employPhone) {
        this.employPhone = employPhone;
    }

    public String getMemoStr() {
        return memoStr;
    }

    public void setMemoStr(String memoStr) {
        this.memoStr = memoStr;
    }

    public List<OrderStatus> getStatusList() {
        return statusList;
    }

    public void setStatusList(List<OrderStatus> statusList) {
        this.statusList = statusList;
    }

    public List<OrderMemo> getMemoList() {
        return memoList;
    }

    public void setMemoList(List<OrderMemo> memoList) {
        this.memoList = memoList;
    }

    public OrderReview getOrderReview() {
        return orderReview;
    }

    public void setOrderReview(OrderReview orderReview) {
        this.orderReview = orderReview;
    }

    public String getCancelCause() {
        return cancelCause;
    }

    public void setCancelCause(String cancelCause) {
        this.cancelCause = cancelCause;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo == null ? null : orderNo.trim();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Date getDeliverTime() {
        return deliverTime;
    }

    public void setDeliverTime(Date deliverTime) {
        this.deliverTime = deliverTime;
    }

    public String getDeliverAddress() {
        return deliverAddress;
    }

    public void setDeliverAddress(String deliverAddress) {
        this.deliverAddress = deliverAddress == null ? null : deliverAddress.trim();
    }

    public Double getDeliverLat() {
        return deliverLat;
    }

    public void setDeliverLat(Double deliverLat) {
        this.deliverLat = deliverLat;
    }

    public Double getDeliverLng() {
        return deliverLng;
    }

    public void setDeliverLng(Double deliverLng) {
        this.deliverLng = deliverLng;
    }

    public Long getPassengerId() {
        return passengerId;
    }

    public void setPassengerId(Long passengerId) {
        this.passengerId = passengerId;
    }

    public String getPassengerName() {
        return passengerName;
    }

    public void setPassengerName(String passengerName) {
        this.passengerName = passengerName == null ? null : passengerName.trim();
    }

    public String getOrderAddress() {
        return orderAddress;
    }

    public void setOrderAddress(String orderAddress) {
        this.orderAddress = orderAddress == null ? null : orderAddress.trim();
    }

    public Double getOrderLat() {
        return orderLat;
    }

    public void setOrderLat(Double orderLat) {
        this.orderLat = orderLat;
    }

    public Double getOrderLng() {
        return orderLng;
    }

    public void setOrderLng(Double orderLng) {
        this.orderLng = orderLng;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName == null ? null : channelName.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Boolean getReview() {
        return review;
    }

    public void setReview(Boolean review) {
        this.review = review;
    }

    public Double getShouldPay() {
        if (null == shouldPay) {
            return 0d;
        }
        return shouldPay;
    }

    public void setShouldPay(Double shouldPay) {
        this.shouldPay = shouldPay;
    }

    public Double getRealPay() {
        if (null == realPay) {
            return 0d;
        }
        return realPay;
    }

    public void setRealPay(Double realPay) {
        this.realPay = realPay;
    }

    public Long getEmployId() {
        return employId;
    }

    public void setEmployId(Long employId) {
        this.employId = employId;
    }

    public String getEmployName() {
        return employName;
    }

    public void setEmployName(String employName) {
        this.employName = employName;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName == null ? null : companyName.trim();
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey == null ? null : appkey.trim();
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    public Boolean getErrandFixPrice() {
        if (null == errandFixPrice) {
            return false;
        }
        return errandFixPrice;
    }

    public void setErrandFixPrice(Boolean errandFixPrice) {
        this.errandFixPrice = errandFixPrice;
    }


    public Double getCashMoney() {
        if (null == cashMoney) {
            return 0d;
        }
        return cashMoney;
    }

    public void setCashMoney(Double cashMoney) {
        this.cashMoney = cashMoney;
    }

    public Double getSignMoney() {
        if (null == signMoney) {
            return 0d;
        }
        return signMoney;
    }

    public void setSignMoney(Double signMoney) {
        this.signMoney = signMoney;
    }

    public Double getBalanceMoney() {
        if (null == balanceMoney) {
            return 0d;
        }
        return balanceMoney;
    }

    public void setBalanceMoney(Double balanceMoney) {
        this.balanceMoney = balanceMoney;
    }

    public Double getMileage() {
        if (null == mileage) {
            return 0d;
        }
        return mileage;
    }

    public void setMileage(Double mileage) {
        this.mileage = mileage;
    }

    public Integer getWaitedTime() {
        if (null == waitedTime) {
            return 0;
        }
        return waitedTime;
    }

    public void setWaitedTime(Integer waitedTime) {
        this.waitedTime = waitedTime;
    }

    public Integer getTravelTime() {
        return travelTime != null ? travelTime : 0;
    }

    public void setTravelTime(Integer travelTime) {
        this.travelTime = travelTime;
    }

    public PayTypeDetails getPrePayTypeDetail() {
        return prePayTypeDetail;
    }

    public void setPrePayTypeDetail(PayTypeDetails prePayTypeDetail) {
        this.prePayTypeDetail = prePayTypeDetail;
    }

    public PayTypeDetails getPayTypeDetails() {
        return payTypeDetails;
    }

    public void setPayTypeDetails(PayTypeDetails payTypeDetails) {
        this.payTypeDetails = payTypeDetails;
    }

    public Double getDriverProfit() {
        if (null == driverProfit) {
            return 0d;
        }
        return driverProfit;
    }

    public void setDriverProfit(Double driverProfit) {
        this.driverProfit = driverProfit;
    }

    public Double getCompanyProfit() {
        if (null == companyProfit) {
            return 0d;
        }
        return companyProfit;
    }

    public void setCompanyProfit(Double companyProfit) {
        this.companyProfit = companyProfit;
    }

    public Long getDriverCompanyId() {
        return driverCompanyId;
    }

    public void setDriverCompanyId(Long driverCompanyId) {
        this.driverCompanyId = driverCompanyId;
    }

    public String getPreAndAfterPayType() {
        if (null != prePayTypeDetail || null != payTypeDetails) {
            String str = "";
            if (null != prePayTypeDetail) {
                if (prePayTypeDetail.equals(PayTypeDetails.sign)) {
                    str = "签单";
                } else if (prePayTypeDetail.equals(PayTypeDetails.balance)) {
                    str = "余额";
                } else if (prePayTypeDetail.equals(PayTypeDetails.alipay)) {
                    str = "支付宝";
                } else if (prePayTypeDetail.equals(PayTypeDetails.weixin)) {
                    str = "微信";
                } else if (prePayTypeDetail.equals(PayTypeDetails.unionpay)) {
                    str = "银联";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_sign)) {
                    str = "优惠券+签单";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_balance)) {
                    str = "优惠券+余额";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_alipay)) {
                    str = "优惠券+支付宝";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_weixin)) {
                    str = "优惠券+微信";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_unionpay)) {
                    str = "优惠券+银联";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_unionpay)) {
                    str = "优惠券+银联";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon)) {
                    str = "优惠券";
                }
            }

            if (null != payTypeDetails) {
                if (payTypeDetails.equals(PayTypeDetails.helppay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "代付";
                    } else {
                        if (!str.contains("代付")) {
                            str += "+代付";
                        }
                    }
                } else if (payTypeDetails.equals(PayTypeDetails.sign)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "签单";
                    } else {
                        if (!str.contains("签单")) {
                            str += "+签单";
                        }
                    }
                } else if (payTypeDetails.equals(PayTypeDetails.balance)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "余额";
                    } else {
                        if (!str.contains("余额")) {
                            str += "+余额";
                        }
                    }
                } else if (payTypeDetails.equals(PayTypeDetails.alipay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "支付宝";
                    } else {
                        if (!str.contains("支付宝")) {
                            str += "+支付宝";
                        }
                    }
                } else if (payTypeDetails.equals(PayTypeDetails.weixin)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "微信";
                    } else {
                        if (!str.contains("微信")) {
                            str += "+微信";
                        }
                    }
                } else if (payTypeDetails.equals(PayTypeDetails.unionpay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "银联";
                    } else {
                        if (!str.contains("银联")) {
                            str += "+银联";
                        }
                    }
                }

            }

            if (!StringUtils.isEmpty(str)) {
                return str;
            } else {
                return null;
            }

        } else {
            return null;
        }
    }

    public String getPreAndAfterPayMoney() {

        String preAndAfterPayType = getPreAndAfterPayType();

        String str = "";
        if (null != preAndAfterPayType) {
            if (preAndAfterPayType.contains("优惠券")) {
                str += couponMoney + "+";
            }
            if (preAndAfterPayType.contains("签单") && preAndAfterPayType.contains("余额")) {
                if (preAndAfterPayType.indexOf("签单") == 0) {
                    str += signMoney + "+" + balanceMoney;
                } else if (preAndAfterPayType.indexOf("余额") == 0) {
                    str += balanceMoney + "+" + signMoney;
                }
            } else if (preAndAfterPayType.contains("签单")) {
                str += signMoney + "+";
            } else if (preAndAfterPayType.contains("余额")) {
                str += balanceMoney + "+";
            }
            if (preAndAfterPayType.contains("支付宝")) {
                str += alipayMoney + "+";
            }
            if (preAndAfterPayType.contains("微信")) {
                str += weixinMoney + "+";
            }
            if (preAndAfterPayType.contains("银联")) {
                str += unionpayMoney + "+";
            }
            if (preAndAfterPayType.contains("代付")) {
                str += cashMoney + "+";
            }
        }

        if (!StringUtils.isEmpty(str)) {
            return str.substring(0, str.length() - 1);
        } else {
            return null;
        }

    }

    public enum PayTypeDetails {
        /**
         * 代付
         */
        helppay,
        /**
         * 签单
         */
        sign,
        /**
         * 余额
         */
        balance,
        /**
         * 支付宝
         */
        alipay,
        /**
         * 微信
         */
        weixin,
        /**
         * 银联支付
         */
        unionpay,
        /**
         * 优惠劵
         */
        coupon,

        /**
         * 优惠劵+签单
         */
        coupon_sign,
        /**
         * 优惠劵+余额
         */
        coupon_balance,
        /**
         * 优惠劵+支付宝
         */
        coupon_alipay,
        /**
         * 优惠劵+微信
         */
        coupon_weixin,
        /**
         * 优惠券+银联
         */
        coupon_unionpay,
        /**
         * 现金
         */
        cash,
        /**
         * 余额+现金
         */
        balance_cash

    }


}
